package com.sec.android.app.calculator;

import android.app.Activity;
import android.content.ContentResolver;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.database.ContentObserver;
import android.graphics.Typeface;
import android.media.AudioManager;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.provider.Settings.System;
import android.text.ClipboardManager;
import android.text.Editable;
import android.text.Selection;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnLongClickListener;
import android.view.View.OnTouchListener;
import android.widget.EditText;
import com.sec.android.widgetapp.calculator.Panel;
import java.util.Hashtable;

public class Calculator extends Activity
  implements View.OnClickListener, View.OnLongClickListener, View.OnTouchListener
{
  private static String local_clip = "";
  private final int CMD_ADVANCED_PANEL = 3;
  private final int CMD_BASIC_PANEL = 2;
  private final int CMD_CLEAR_HISTORY = 1;
  private int[] bt_id;
  private Bundle bundle;
  private ClipboardManager clipboard;
  private CustomContentObserver customObserver;
  private AudioManager mAudioManager;
  boolean mDTMFToneEnabled;
  private EditText mDisplay;
  private History mHistory;
  private EditText mHistoryScreen;
  private EventListener mListener;
  private EventHandler mLogic;
  private Panel mPanel;
  private Persist mPersist;
  private View review;

  public Calculator()
  {
    int[] arrayOfInt = new int[35];
    arrayOfInt[0] = 2130968602;
    arrayOfInt[1] = 2130968598;
    arrayOfInt[2] = 2130968599;
    arrayOfInt[3] = 2130968600;
    arrayOfInt[4] = 2130968594;
    arrayOfInt[5] = 2130968595;
    arrayOfInt[6] = 2130968596;
    arrayOfInt[7] = 2130968590;
    arrayOfInt[8] = 2130968591;
    arrayOfInt[9] = 2130968592;
    arrayOfInt[10] = 2130968603;
    arrayOfInt[11] = 2130968604;
    arrayOfInt[12] = 2130968605;
    arrayOfInt[13] = 2130968597;
    arrayOfInt[14] = 2130968593;
    arrayOfInt[15] = 2130968588;
    arrayOfInt[16] = 2130968587;
    arrayOfInt[17] = 2130968586;
    arrayOfInt[18] = 2130968589;
    arrayOfInt[19] = 2130968601;
    arrayOfInt[20] = 2130968606;
    arrayOfInt[21] = 2130968607;
    arrayOfInt[22] = 2130968608;
    arrayOfInt[23] = 2130968609;
    arrayOfInt[24] = 2130968611;
    arrayOfInt[25] = 2130968613;
    arrayOfInt[26] = 2130968612;
    arrayOfInt[27] = 2130968610;
    arrayOfInt[28] = 2130968614;
    arrayOfInt[29] = 2130968615;
    arrayOfInt[30] = 2130968616;
    arrayOfInt[31] = 2130968617;
    arrayOfInt[32] = 2130968618;
    arrayOfInt[33] = 2130968619;
    arrayOfInt[34] = 2130968620;
    this.bt_id = arrayOfInt;
  }

  private void initControls()
  {
    this.mDisplay = ((EditText)findViewById(2130968581));
    this.mHistoryScreen = ((EditText)findViewById(2130968580));
    this.mPanel = ((Panel)findViewById(2130968582));
    this.mListener = new EventListener();
    this.mLogic = new EventHandler(this, this.mDisplay, this.mHistoryScreen, this.mHistory);
    registerForContextMenu(this.mDisplay);
    registerForContextMenu(this.mHistoryScreen);
    this.clipboard = ((ClipboardManager)getSystemService("clipboard"));
    this.mListener.setHandler(this.mLogic, this.mPanel, this.mDisplay, this.mHistoryScreen, this.mHistory);
    this.mPanel.setOnPanelListener(this.mListener);
    this.mDisplay.setOnTouchListener(this);
    this.mDisplay.setOnLongClickListener(this);
    this.mHistoryScreen.setOnTouchListener(this);
    this.mHistoryScreen.setOnLongClickListener(this);
    for (int i = 0; i < this.bt_id.length; i++)
    {
      View localView = findViewById(this.bt_id[i]);
      localView.setOnTouchListener(this);
      localView.setOnClickListener(this);
      localView.setSoundEffectsEnabled(false);
      if (localView != findViewById(2130968589))
        continue;
      localView.setOnLongClickListener(this.mListener);
    }
    initTrueFont();
  }

  private void initTrueFont()
  {
    Typeface localTypeface = Typeface.createFromAsset(getAssets(), "fonts/GS45_EU_TouchWiz.ttf");
    this.mDisplay.setTypeface(localTypeface);
    this.mHistoryScreen.setTypeface(localTypeface);
  }

  public void button_image_change(View paramView, int paramInt)
  {
    int i = 0;
    new int[1][i] = 0;
    if (getResources().getConfiguration().orientation == 2);
    for (int j = paramInt + 2; ; j = paramInt)
    {
      switch (j)
      {
      default:
      case 1:
      case 2:
      case 3:
      case 4:
      }
      while (true)
      {
        return;
        int[] arrayOfInt = new int[20];
        arrayOfInt[0] = 2130837599;
        arrayOfInt[1] = 2130837601;
        arrayOfInt[2] = 2130837603;
        arrayOfInt[3] = 2130837605;
        arrayOfInt[4] = 2130837607;
        arrayOfInt[5] = 2130837609;
        arrayOfInt[6] = 2130837611;
        arrayOfInt[7] = 2130837613;
        arrayOfInt[8] = 2130837615;
        arrayOfInt[9] = 2130837617;
        arrayOfInt[10] = 2130837524;
        arrayOfInt[11] = 2130837526;
        arrayOfInt[12] = 2130837522;
        arrayOfInt[13] = 2130837520;
        arrayOfInt[14] = 2130837518;
        arrayOfInt[15] = 2130837516;
        arrayOfInt[16] = 2130837514;
        arrayOfInt[17] = 2130837512;
        arrayOfInt[18] = 2130837510;
        arrayOfInt[19] = 2130837508;
        Hashtable localHashtable;
        while (true)
        {
          localHashtable = new Hashtable();
          while (i < arrayOfInt.length)
          {
            localHashtable.put(Integer.valueOf(this.bt_id[i]), Integer.valueOf(i));
            i++;
          }
          arrayOfInt = new int[20];
          arrayOfInt[0] = 2130837598;
          arrayOfInt[1] = 2130837600;
          arrayOfInt[2] = 2130837602;
          arrayOfInt[3] = 2130837604;
          arrayOfInt[4] = 2130837606;
          arrayOfInt[5] = 2130837608;
          arrayOfInt[6] = 2130837610;
          arrayOfInt[7] = 2130837612;
          arrayOfInt[8] = 2130837614;
          arrayOfInt[9] = 2130837616;
          arrayOfInt[10] = 2130837523;
          arrayOfInt[11] = 2130837525;
          arrayOfInt[12] = 2130837521;
          arrayOfInt[13] = 2130837519;
          arrayOfInt[14] = 2130837517;
          arrayOfInt[15] = 2130837515;
          arrayOfInt[16] = 2130837513;
          arrayOfInt[17] = 2130837511;
          arrayOfInt[18] = 2130837509;
          arrayOfInt[19] = 2130837507;
          continue;
          arrayOfInt = new int[35];
          arrayOfInt[0] = 2130837590;
          arrayOfInt[1] = 2130837576;
          arrayOfInt[2] = 2130837578;
          arrayOfInt[3] = 2130837580;
          arrayOfInt[4] = 2130837562;
          arrayOfInt[5] = 2130837564;
          arrayOfInt[6] = 2130837566;
          arrayOfInt[7] = 2130837548;
          arrayOfInt[8] = 2130837550;
          arrayOfInt[9] = 2130837552;
          arrayOfInt[10] = 2130837592;
          arrayOfInt[11] = 2130837594;
          arrayOfInt[12] = 2130837596;
          arrayOfInt[13] = 2130837568;
          arrayOfInt[14] = 2130837554;
          arrayOfInt[15] = 2130837538;
          arrayOfInt[16] = 2130837536;
          arrayOfInt[17] = 2130837534;
          arrayOfInt[18] = 2130837540;
          arrayOfInt[19] = 2130837582;
          arrayOfInt[20] = 2130837530;
          arrayOfInt[21] = 2130837528;
          arrayOfInt[22] = 2130837532;
          arrayOfInt[23] = 2130837542;
          arrayOfInt[24] = 2130837544;
          arrayOfInt[25] = 2130837546;
          arrayOfInt[26] = 2130837556;
          arrayOfInt[27] = 2130837558;
          arrayOfInt[28] = 2130837560;
          arrayOfInt[29] = 2130837570;
          arrayOfInt[30] = 2130837572;
          arrayOfInt[31] = 2130837574;
          arrayOfInt[32] = 2130837584;
          arrayOfInt[33] = 2130837586;
          arrayOfInt[34] = 2130837588;
          continue;
          arrayOfInt = new int[35];
          arrayOfInt[0] = 2130837589;
          arrayOfInt[1] = 2130837575;
          arrayOfInt[2] = 2130837577;
          arrayOfInt[3] = 2130837579;
          arrayOfInt[4] = 2130837561;
          arrayOfInt[5] = 2130837563;
          arrayOfInt[6] = 2130837565;
          arrayOfInt[7] = 2130837547;
          arrayOfInt[8] = 2130837549;
          arrayOfInt[9] = 2130837551;
          arrayOfInt[10] = 2130837591;
          arrayOfInt[11] = 2130837593;
          arrayOfInt[12] = 2130837595;
          arrayOfInt[13] = 2130837567;
          arrayOfInt[14] = 2130837553;
          arrayOfInt[15] = 2130837537;
          arrayOfInt[16] = 2130837535;
          arrayOfInt[17] = 2130837533;
          arrayOfInt[18] = 2130837539;
          arrayOfInt[19] = 2130837581;
          arrayOfInt[20] = 2130837529;
          arrayOfInt[21] = 2130837527;
          arrayOfInt[22] = 2130837531;
          arrayOfInt[23] = 2130837541;
          arrayOfInt[24] = 2130837543;
          arrayOfInt[25] = 2130837545;
          arrayOfInt[26] = 2130837555;
          arrayOfInt[27] = 2130837557;
          arrayOfInt[28] = 2130837559;
          arrayOfInt[29] = 2130837569;
          arrayOfInt[30] = 2130837571;
          arrayOfInt[31] = 2130837573;
          arrayOfInt[32] = 2130837583;
          arrayOfInt[33] = 2130837585;
          arrayOfInt[34] = 2130837587;
        }
        Integer localInteger = (Integer)localHashtable.get(Integer.valueOf(paramView.getId()));
        if (localInteger == null)
          continue;
        paramView.setBackgroundResource(arrayOfInt[localInteger.intValue()]);
      }
    }
  }

  public void checkOrientation()
  {
    if (Settings.System.getInt(getContentResolver(), "accelerometer_rotation", 0) == 1)
      setRequestedOrientation(4);
    while (true)
    {
      return;
      switch (getResources().getConfiguration().orientation)
      {
      default:
        break;
      case 1:
        setRequestedOrientation(1);
        break;
      case 2:
        setRequestedOrientation(0);
      }
    }
  }

  public void onClick(View paramView)
  {
    this.review = paramView;
    this.mListener.onClick(paramView);
  }

  public boolean onContextItemSelected(MenuItem paramMenuItem)
  {
    View localView = getCurrentFocus();
    int n;
    if (localView == null)
      n = 0;
    label12: EditText localEditText;
    int i;
    int j;
    while (true)
    {
      return n;
      if ((localView.getId() != 2130968581) && (localView.getId() != 2130968580))
      {
        n = 0;
        continue;
      }
      this.mLogic.showCursor();
      if (localView.getId() == 2130968580);
      for (localEditText = this.mHistoryScreen; ; localEditText = this.mDisplay)
      {
        i = this.mLogic.getCursor(localEditText, true);
        j = this.mLogic.getCursor(localEditText, false);
        if ((paramMenuItem.getItemId() != 16908328) && (paramMenuItem.getItemId() != 16908329))
          this.mLogic.setSelecting(false);
        switch (paramMenuItem.getItemId())
        {
        case 16908323:
        case 16908324:
        case 16908325:
        case 16908326:
        case 16908327:
        default:
          n = 0;
          break label12;
        case 16908319:
        case 16908328:
        case 16908329:
        case 16908321:
        case 16908320:
        case 16908322:
        }
      }
      Selection.setSelection(localEditText.getText(), 0, localEditText.getText().length());
      this.mLogic.setSelecting(true);
      n = 1;
      continue;
      if (this.mLogic.isMultiSelection(localEditText))
        localEditText.setSelection(localEditText.getSelectionEnd());
      this.mLogic.onShift(localEditText, true);
      n = 1;
      continue;
      this.mLogic.onShift(localEditText, false);
      localEditText.setSelection(localEditText.getSelectionEnd());
      this.mLogic.goneCursor();
      n = 1;
    }
    if (i == j);
    for (String str4 = localEditText.getText().toString(); ; str4 = localEditText.getText().toString().substring(i, j))
    {
      local_clip = str4;
      this.clipboard.setText(local_clip);
      localEditText.dispatchKeyEvent(new KeyEvent(1, 59));
      localEditText.setSelected(false);
      this.mLogic.goneCursor();
      n = 1;
      break;
    }
    String str3;
    if (i == j)
    {
      str3 = localEditText.getText().toString();
      label388: local_clip = str3;
      if (i != j)
        break label456;
      localEditText.setText("");
    }
    while (true)
    {
      this.clipboard.setText(local_clip);
      this.mLogic.goneCursor();
      this.mLogic.mEnterEnd = false;
      n = 1;
      break;
      str3 = localEditText.getText().toString().substring(i, j);
      break label388;
      label456: localEditText.getText().replace(i, j, "");
    }
    if (this.mDisplay.getText().toString().contains("="))
      this.mLogic.onClear();
    if (this.mDisplay.getText().toString().length() > 0);
    for (int k = 1; ; k = 0)
    {
      this.mLogic.setFrontText(this.mDisplay.getText().toString());
      StringBuilder localStringBuilder = new StringBuilder();
      String str1 = this.clipboard.getText().toString();
      int m = str1.indexOf("=");
      if ((m > 0) && (k != 0));
      for (String str2 = this.clipboard.getText().toString().substring(0, m - 1); ; str2 = str1)
      {
        localStringBuilder.append(str2);
        this.mLogic.mPaste = true;
        this.mLogic.insert(localStringBuilder);
        this.mLogic.goneCursor();
        this.mLogic.mEnterEnd = false;
        n = 1;
        break;
      }
    }
  }

  public void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    Uri localUri = Settings.System.CONTENT_URI;
    this.customObserver = new CustomContentObserver();
    this.customObserver.onChange(true);
    getContentResolver().registerContentObserver(localUri, true, this.customObserver);
    this.mPersist = new Persist(this);
    this.bundle = new Bundle();
    this.mHistory = this.mPersist.history;
    this.mAudioManager = ((AudioManager)getSystemService("audio"));
    setContentView(2130903040);
    initControls();
    int i;
    int j;
    EditText localEditText;
    if (paramBundle != null)
    {
      i = paramBundle.getInt("mStart");
      j = paramBundle.getInt("mEnd");
      this.mLogic.mEnterEnd = paramBundle.getBoolean("mEnterEnd");
      boolean bool = paramBundle.getBoolean("mPanelState");
      if (!bool)
        break label289;
      localEditText = this.mDisplay;
      if (!bool)
      {
        this.mPanel.getContent().setVisibility(8);
        this.mPanel.getHandle().setBackgroundDrawable(this.mPanel.getClosedHandle());
        this.mListener.onPanelClosedForConfig();
      }
      this.mLogic.setmCursorState(paramBundle.getBoolean("mCursorState"));
      localEditText.setCursorVisible(paramBundle.getBoolean("mCursorState"));
      localEditText.setText(this.mLogic.changeColor(paramBundle.getString("String")));
      int k = localEditText.getText().toString().length();
      if (i > k)
        i = k;
      if (j > k)
        j = k;
      if (i != j)
        break label298;
      this.mLogic.goneCursor();
    }
    while (true)
    {
      return;
      label289: localEditText = this.mHistoryScreen;
      break;
      label298: this.bundle.putInt("mStart", i);
      this.bundle.putInt("mEnd", j);
      this.bundle.putBoolean("isSelecting", paramBundle.getBoolean("isSelecting"));
    }
  }

  public void onCreateContextMenu(ContextMenu paramContextMenu, View paramView, ContextMenu.ContextMenuInfo paramContextMenuInfo)
  {
    if ((paramView.getId() != 2130968581) && (paramView.getId() != 2130968580))
      return;
    EditText localEditText;
    label34: String str1;
    String str2;
    int k;
    label193: int m;
    label208: int j;
    if (paramView.getId() == 2130968580)
    {
      localEditText = this.mHistoryScreen;
      if ((this.mLogic.isSelecting()) || (this.mLogic.isMultiSelection(localEditText)))
        this.mLogic.showCursor();
      paramContextMenu.removeItem(16908322);
      paramContextMenu.removeItem(16908324);
      paramContextMenu.removeItem(16908330);
      paramContextMenu.removeItem(16908321);
      paramContextMenu.removeItem(16908320);
      paramContextMenu.removeItem(16908319);
      paramContextMenu.removeItem(16908328);
      paramContextMenu.removeItem(16908329);
      str1 = local_clip.toString();
      str2 = this.clipboard.getText().toString();
      if (localEditText.length() > 0)
      {
        paramContextMenu.add(0, 16908319, 0, 2131034129);
        if (!this.mLogic.isSelecting())
          break label379;
        k = 16908329;
        if (!this.mLogic.isSelecting())
          break label387;
        m = 2131034131;
        paramContextMenu.add(0, k, 0, m);
      }
      if ((paramView.getId() == 2130968581) && (localEditText.length() > 0))
      {
        if (localEditText.getSelectionStart() == localEditText.getSelectionEnd())
          break label395;
        j = 2131034127;
        label256: paramContextMenu.add(0, 16908320, 0, j);
      }
      if (localEditText.length() > 0)
        if (localEditText.getSelectionStart() == localEditText.getSelectionEnd())
          break label403;
    }
    label387: label395: label403: for (int i = 2131034125; ; i = 2131034124)
    {
      paramContextMenu.add(0, 16908321, 0, i);
      if ((paramView.getId() == 2130968581) && (str1.length() > 0) && (str2.length() > 0) && (str1.equals(str2)))
        paramContextMenu.add(0, 16908322, 0, 2131034128);
      super.onCreateContextMenu(paramContextMenu, paramView, paramContextMenuInfo);
      break;
      localEditText = this.mDisplay;
      break label34;
      label379: k = 16908328;
      break label193;
      m = 2131034130;
      break label208;
      j = 2131034126;
      break label256;
    }
  }

  public boolean onCreateOptionsMenu(Menu paramMenu)
  {
    this.mLogic.goneCursor();
    paramMenu.add(0, 1, 0, 2131034132).setIcon(2130837623);
    paramMenu.add(0, 3, 0, 2131034122).setIcon(2130837621);
    paramMenu.add(0, 2, 0, 2131034123).setIcon(2130837622);
    return super.onCreateOptionsMenu(paramMenu);
  }

  public void onDestroy()
  {
    super.onDestroy();
  }

  public boolean onKeyDown(int paramInt, KeyEvent paramKeyEvent)
  {
    if ((82 == paramInt) && ((paramKeyEvent.isLongPress()) || (paramKeyEvent.getRepeatCount() > 0)))
      closeOptionsMenu();
    return super.onKeyDown(paramInt, paramKeyEvent);
  }

  public boolean onLongClick(View paramView)
  {
    if (paramView.getId() == 2130968580);
    for (EditText localEditText = this.mHistoryScreen; ; localEditText = this.mDisplay)
    {
      if (!this.mLogic.getmCursorState())
        localEditText.setSelection(localEditText.getSelectionEnd());
      this.mLogic.setLongClick(true);
      return false;
    }
  }

  public boolean onOptionsItemSelected(MenuItem paramMenuItem)
  {
    switch (paramMenuItem.getItemId())
    {
    default:
    case 1:
    case 2:
    case 3:
    }
    while (true)
    {
      return true;
      this.mLogic.onHisClear();
      this.mLogic.goneCursor();
      continue;
      setRequestedOrientation(1);
      continue;
      setRequestedOrientation(0);
    }
  }

  public void onPause()
  {
    super.onPause();
    this.mPersist.save();
    if (this.clipboard.hasText())
      this.clipboard.setText(this.clipboard.getText().toString());
  }

  public boolean onPrepareOptionsMenu(Menu paramMenu)
  {
    int i = Settings.System.getInt(getContentResolver(), "accelerometer_rotation", 0);
    int j = getResources().getConfiguration().orientation;
    if (this.mLogic.isSelecting())
      this.mLogic.setSelecting(false);
    MenuItem localMenuItem = paramMenu.findItem(1);
    boolean bool;
    int k;
    int m;
    if ((this.mLogic.isDisplayScreen()) || (this.mLogic.isHistoryScreen()))
    {
      bool = true;
      localMenuItem.setVisible(bool);
      if (i != 0)
        break label165;
      switch (j)
      {
      default:
        k = 2;
        m = 3;
        label114: paramMenu.findItem(k).setVisible(true);
        paramMenu.findItem(m).setVisible(false);
      case 1:
      }
    }
    while (true)
    {
      return super.onPrepareOptionsMenu(paramMenu);
      bool = false;
      break;
      k = 3;
      m = 2;
      break label114;
      label165: paramMenu.findItem(3).setVisible(false);
      paramMenu.findItem(2).setVisible(false);
    }
  }

  public void onResume()
  {
    super.onResume();
    boolean bool1;
    int j;
    int k;
    if (Settings.System.getInt(getContentResolver(), "dtmf_tone", 1) == 1)
    {
      bool1 = true;
      this.mDTMFToneEnabled = bool1;
      int i = this.bundle.getInt("mReview");
      j = this.bundle.getInt("mStart", 0);
      k = this.bundle.getInt("mEnd", 0);
      boolean bool2 = this.bundle.getBoolean("isSelecting", false);
      if ((i != 0) && (this.bundle.getInt("mOrientation") == getResources().getConfiguration().orientation))
      {
        this.review = findViewById(i);
        button_image_change(this.review, 2);
        this.bundle.clear();
      }
      if ((this.mDisplay != null) && (this.mDisplay.length() != 0))
      {
        String[] arrayOfString = this.mDisplay.getText().toString().split("=");
        if (arrayOfString.length > 1)
        {
          this.mDisplay.setText(this.mLogic.changeColor(arrayOfString[0].trim() + "="));
          this.mLogic.onEnter(false);
        }
      }
      if (!bool2)
        break label299;
      if (!this.mPanel.isOpen())
        break label290;
    }
    label290: for (EditText localEditText2 = this.mDisplay; ; localEditText2 = this.mHistoryScreen)
    {
      int m = localEditText2.getText().length();
      if ((m > j) && (m >= k))
      {
        Selection.setSelection(localEditText2.getText(), j, k);
        this.mLogic.onShift(localEditText2, true);
      }
      return;
      bool1 = false;
      break;
    }
    label299: if (this.mDisplay.getVisibility() == 0);
    for (EditText localEditText1 = this.mDisplay; ; localEditText1 = this.mHistoryScreen)
    {
      this.mLogic.onShift(localEditText1, false);
      localEditText1.setSelection(localEditText1.getSelectionEnd());
      this.mLogic.goneCursor();
      break;
    }
  }

  protected void onSaveInstanceState(Bundle paramBundle)
  {
    paramBundle.putBoolean("mPanelState", this.mPanel.isOpen());
    paramBundle.putBoolean("mEnterEnd", this.mLogic.isCheckResult());
    paramBundle.putBoolean("mCursorState", this.mLogic.getmCursorState());
    paramBundle.putBoolean("isSelecting", this.mLogic.isSelecting());
    Bundle localBundle = this.bundle;
    int i;
    EditText localEditText1;
    label126: EditText localEditText2;
    if (this.review != null)
    {
      i = this.review.getId();
      localBundle.putInt("mReview", i);
      this.bundle.putInt("mOrientation", getResources().getConfiguration().orientation);
      EventHandler localEventHandler1 = this.mLogic;
      if (!this.mPanel.isOpen())
        break label220;
      localEditText1 = this.mDisplay;
      paramBundle.putInt("mStart", localEventHandler1.getCursor(localEditText1, true));
      EventHandler localEventHandler2 = this.mLogic;
      if (!this.mPanel.isOpen())
        break label229;
      localEditText2 = this.mDisplay;
      label163: paramBundle.putInt("mEnd", localEventHandler2.getCursor(localEditText2, false));
      if (!this.mPanel.isOpen())
        break label238;
    }
    label220: label229: label238: for (String str = this.mDisplay.getText().toString(); ; str = this.mHistoryScreen.getText().toString())
    {
      paramBundle.putString("String", str);
      super.onSaveInstanceState(paramBundle);
      return;
      i = 0;
      break;
      localEditText1 = this.mHistoryScreen;
      break label126;
      localEditText2 = this.mHistoryScreen;
      break label163;
    }
  }

  public void onStop()
  {
    super.onStop();
  }

  public boolean onTouch(View paramView, MotionEvent paramMotionEvent)
  {
    if ((paramView.getId() != 2130968581) && (paramView.getId() != 2130968580))
      this.mLogic.goneCursor();
    if ((paramView.getId() == 2130968581) || (paramView.getId() == 2130968580))
    {
      if (paramMotionEvent.getAction() == 1)
        if (paramView.getId() != 2130968580)
          break label123;
      label123: for (EditText localEditText = this.mHistoryScreen; ; localEditText = this.mDisplay)
      {
        if ((!this.mLogic.isSelecting()) && ((!this.mLogic.isMultiSelection(localEditText)) || (!this.mLogic.isLongClick())))
          this.mLogic.goneCursor();
        if (this.mLogic.isLongClick())
          this.mLogic.setLongClick(false);
        return false;
      }
    }
    switch (paramMotionEvent.getAction())
    {
    default:
    case 0:
    case 1:
    }
    while (true)
    {
      break;
      onVibrator(paramView);
      if (this.mDTMFToneEnabled)
      {
        int i = this.mAudioManager.getRingerMode();
        if ((i != 0) || (i == 1))
          this.mAudioManager.playSoundEffect(5);
      }
      button_image_change(paramView, 1);
      this.mLogic.delst = true;
      this.review = paramView;
      continue;
      button_image_change(paramView, 2);
      this.mLogic.delst = false;
    }
  }

  public void onVibrator(View paramView)
  {
    paramView.setHapticFeedbackEnabled(true);
    paramView.performHapticFeedback(9);
  }

  public class CustomContentObserver extends ContentObserver
  {
    public CustomContentObserver()
    {
      super();
    }

    public void onChange(boolean paramBoolean)
    {
      Calculator.this.checkOrientation();
      super.onChange(paramBoolean);
    }
  }
}

/* Location:           C:\Development\Android_Java_C\Workspace\TouchWizCalculator\TouchWizCalculator_dex2jar.jar
 * Qualified Name:     com.sec.android.app.calculator.Calculator
 * JD-Core Version:    0.6.0
 */